let chren = args.form;
let result = 0;
chren.forEach(function(item,index,array){
  let id = item.id;
	result = lib.dbUpdate('UPDATE inventory t RIGHT JOIN (SELECT  if (a.product_good_num is null, 0 , a.product_good_num) as product_good_num,if (a.product_bad_num is null, 0, a.product_bad_num) as product_bad_num,a.warehouse_id,a.shop_id,a.product_id FROM quality_check_storage a WHERE id = ? ) t1 ON t.stock_id = t1.warehouse_id AND t.item_id = t1.product_id AND t.shop = t1.shop_id SET t.availble_num = if(t.availble_num is null, 0 , t.availble_num) + t1.product_good_num,t.defective_quantity = if(t.defective_quantity is null, 0, t.defective_quantity) + t1.product_bad_num WHERE t.del_flag=0',id); 
});
result;